//
//  HeaderCollectionReusableView.m
//  YYPHSpeedJump
//
//  Created by speedjump on 16/1/28.
//  Copyright © 2016年 sujiang. All rights reserved.
//

#import "HeaderCollectionReusableView.h"
#import "MyPurchaseViewController.h"
@implementation HeaderCollectionReusableView
{
    NSInteger page;
}
- (void)setModel1:(PurchaseModel *)model1
{
    
    self.zanLable1.text =[NSString stringWithFormat:@"%@/100",model1.up_num];
    self.goodName1.text =model1.wish_commodity_name;
    
    NSArray *timeArr = [model1.create_time componentsSeparatedByString:@" "];
    self.timeLable1.text = [NSString stringWithFormat:@"%@",timeArr[0]];
    
    NSArray *arr= [model1.img_url componentsSeparatedByString:@";"];
    [self.firstImageView sd_setImageWithURL:[NSURL URLWithString:arr[0]] placeholderImage:nil];
}

- (void)setModel2:(PurchaseModel *)model2
{
   
    self.zanLabel2.text =[NSString stringWithFormat:@"%@/100",model2.up_num];
    self.goodName2.text =model2.wish_commodity_name;
    
    NSArray *timeArr = [model2.create_time componentsSeparatedByString:@" "];
    self.timeLabel2.text = [NSString stringWithFormat:@"%@",timeArr[0]];
    
    NSArray *arr= [model2.img_url componentsSeparatedByString:@";"];
    [self.secondImageView sd_setImageWithURL:[NSURL URLWithString:arr[0]] placeholderImage:nil];
}
- (void)setModel3:(PurchaseModel *)model3
{
    
    self.zanLabel3.text =[NSString stringWithFormat:@"%@/100",model3.up_num];
    self.goodName3.text =model3.wish_commodity_name;
    
    NSArray *timeArr = [model3.create_time componentsSeparatedByString:@" "];
    self.timeLable3.text = [NSString stringWithFormat:@"%@",timeArr[0]];
    
    NSArray *arr= [model3.img_url componentsSeparatedByString:@";"];
    [self.threeImageView sd_setImageWithURL:[NSURL URLWithString:arr[0]] placeholderImage:nil];
   
}

- (void)awakeFromNib {
    // Initialization code
    self.firstView.transform = CGAffineTransformMakeRotation(-M_PI/20);
    self.secondView.transform = CGAffineTransformMakeRotation(M_PI/36);
    self.threeView.transform =CGAffineTransformMakeRotation(M_PI/36);
    self.firstView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"心愿排行背景"]];
    self.secondView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"心愿排行背景"]];
    self.threeView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"心愿排行背景"]];
    self.firstNameView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"nameBackgrondColor"]];
    self.firstView.layer.cornerRadius = 5;
    
    self.secondNameView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"nameBackgrondColor"]];
    self.secondView.layer.cornerRadius = 5;
    self.threeNameView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"nameBackgrondColor"]];
    self.threeView.layer.cornerRadius = 5;
    self.firstImageView.layer.cornerRadius = 5;
    self.secondImageView.layer.cornerRadius = 5;
    self.threeImageView.layer.cornerRadius = 5;
    self.firstImageView.layer.masksToBounds =YES;
     self.secondImageView.layer.masksToBounds =YES;
     self.threeImageView.layer.masksToBounds =YES;
    self.purchaseTitle.layer.cornerRadius = 5;
        self.firstView.hidden =YES;
        self.secondView.hidden =YES;
        self.threeView.hidden =YES;
   
   
}

@end
